#include "StringUtil.h"
#include <windows.h>

namespace StringUtil
{
	std::wstring charToWideString(const char* str)
	{
		int size = ::MultiByteToWideChar(CP_ACP,0,str,-1,NULL,0);
		wchar_t* buf = new wchar_t[size];
		MultiByteToWideChar(CP_ACP,0,str,-1,buf,size);
		return std::wstring(buf,size);
	}
	std::string wideCharToString(const wchar_t* wstr)
	{
		int size = WideCharToMultiByte(CP_ACP,0,wstr,-1,NULL,0,NULL,NULL);
		char* buf = new char[size];
		WideCharToMultiByte(CP_ACP,0,wstr,-1,buf,size,NULL,NULL);
		return std::string(buf,size);
	}
};